
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '/widget/app_bar.dart';
import '/widget/bottom_nav.dart';
import 'home_logic.dart';

/// <summary>
/// todo: 菜单首页
/// author：zwb
/// dateTime： 2021/11/3 11:46
/// filePath： lib/constant/system.dart
/// desc:
/// <summary>
///
class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  final logic = Get.put(HomeLogic());

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<HomeLogic>(
      builder: (controller) {
        return Scaffold(
          body: logic.bodyData[logic.currentIndex],
          bottomNavigationBar: bottomNavWidget(
            currentIndex: logic.currentIndex,
            menuData: logic.menuData,
            onTap: (v) => logic.setIndex(v),
          ),
        );
      },
    );
  }

  @override
  void dispose() {
    Get.delete<HomeLogic>();
    super.dispose();
  }
}